<template>
  <div class="order-item">
    <div class="order-item-panel">
      <el-row class="panel-top-label">
        <el-col :span="6">
          <el-checkbox @change="selectItemChange($event, orderItem.id)" />
          <span class="ml-10">订单号：21343234234234</span>
        </el-col>
        <el-col :span="6">
          <span>下单时间：234234234234</span>
        </el-col>
        <el-col :span="6">
          <span style="color: #293c66">下单平台：</span>
        </el-col>
        <el-col :span="4" :offset="2" align="center">
          <span>挖咖平台-自营订单</span>
        </el-col>
      </el-row>
      <div>
        <div class="panel-top-info ft-12">
          <el-row class="flex items-center">
            <el-col :span="4">
              <span>收货人：</span>
              <span>老斑鸠啦啦啦</span>
            </el-col>
            <el-col :span="4">
              <span>联系电话：</span>
              <span>123123123123</span>
            </el-col>
            <el-col :span="8">
              <span>地址：</span>
              <span>213123123123</span>
            </el-col>
            <el-col :span="4"> 配送方式：快递配送</el-col>
            <el-col :span="4" align="center">
              <el-button type="text" @click="goOrderDetail(orderItem.orderNo)">订单详情</el-button>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="panel-content-box ft-12">
        <el-row class="panel-content" v-for="item in 2" :key="item.goodsSkuId">
          <el-col :span="3">
            <div>
              <div class="flex">
                <el-image
                  class="panel-content-img"
                  src="http://dummyimage.com/100x100/999999/ff4400.png&text=EXAMPLE"
                  :preview-src-list="[item.goodsSkuGraph]"
                />
                <div class="panel-content-text flex flex-col justify-between ml-5">
                  <p class="panel-content_title" style="color: #293c66">酒鬼酒</p>
                  <p>123123</p>
                </div>
              </div>
            </div>
          </el-col>
          <el-col :span="3" class="text-center">
            <p>1299</p>
            <p class="mt-10">¥12</p>
            <p class="mt-10">2</p>
          </el-col>
          <el-col :span="3" class="text-center"> 暂无 </el-col>

          <el-col :span="3" class="text-center">
            <span>积分</span>
          </el-col>
          <el-col :span="3" class="text-center"> 已完成 </el-col>
          <el-col :span="3" class="text-center"> 暂无 </el-col>
          <el-col :span="3" class="text-center"> </el-col>
        </el-row>
      </div>
    </div>
  </div>
</template>

<script>
import { mapMutations, mapState } from 'vuex'
export default {
  name: 'OrderStoreItem',
  props: {
    orderItem: {
      type: Object,
      default: () => {}
    }
  },
  components: {},
  data() {
    return {
      rowData: [],
      dialogVisible: false,
      dialogExpressVisible: false
    }
  },
  computed: {
    ...mapState('order', ['isAll'])
  },
  methods: {
    ...mapMutations('order', ['SELECT_ITEM_CHANGE', 'SELECT_CHECKED_ALL_CHANGE']),
    // 订单详情
    goOrderDetail(orderNo) {
      this.$router.push({ name: 'OrderDetail', query: { orderNo } })
    },
    selectItemChange(checked, id) {
      this.SELECT_ITEM_CHANGE({ key: 'orderList', checked, id })
      this.SELECT_CHECKED_ALL_CHANGE({ key: 'orderList' })
    },

    // 查看物流
    viewLogistics() {
      this.dialogExpressVisible = true
    },
    update() {
      this.$emit('update')
    }
  }
}
</script>

<style lang="scss" scoped>
.order-item {
  font-size: 14px;
  margin-top: 15px;
  border: 1px solid #e4e7ed;
  .panel-top-label {
    height: 40px;
    line-height: 40px;
    font-size: 14px;
    padding: 0 20px;
    background-color: $hw-bg-color-grey;
    .operate-Label-item {
      font-weight: bold;
    }
  }
  .panel-top-info {
    padding: 10px 20px;
    background-color: #e2f1f9;
  }
  .panel-content {
    display: flex;
    align-items: center;
    padding: 15px 0px;
    margin: 0 20px;
    font-size: 12px;
    border-bottom: 1px solid #f2f2f2;
    &:last-child {
      border: none;
    }
    &-img {
      width: 50px;
      height: 50px;
    }
    &-text {
      flex: 1;
      cursor: pointer;
      padding: 2px 0;
    }
    .price-num-text {
      padding: 10px 0;
    }
    .lease-text {
      padding: 5px 0;
    }
  }
}
.detal-text {
  color: $hw-text-color;
  cursor: pointer;
}
.text-center {
  text-align: center;
}
.panel-content_title {
  @include ellipsis(2);
  word-break: break-word;
}
</style>
